package com.neusoft.web.a1;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.neusoft.services.impl.a1.CharacterServiceImpl;

/**
 * Servlet implementation class charaInfo
 */
@WebServlet("/charaInfo")
public class charaInfo extends HttpServlet {
	
	private CharacterServiceImpl services = new CharacterServiceImpl();
	Map<String,String> map = new HashMap();
	Map<String,String> user = new HashMap();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		//System.out.println(request.getParameter("iid"));
		String cid = request.getParameter("iid").toString();
		//System.out.println(cid);
		try {
			map = services.findById(cid);
			System.out.println(map);
		}catch(Exception e){
			e.printStackTrace();
		}finally {
			request.setAttribute("map", map);
			request.getRequestDispatcher("Character/Info_Character.jsp").forward(request, response);
		}
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
